<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="pessoaSearch" styleClass="edit">

        <rich:simpleTogglePanel label="Pessoa Search Filter" switchType="ajax">

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Nome</ui:define>
                <h:inputText id="nome" value="#{pessoaList.pessoa.nome}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Endereco</ui:define>
                <h:inputText id="endereco" value="#{pessoaList.pessoa.endereco}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Bairro</ui:define>
                <h:inputText id="bairro" value="#{pessoaList.pessoa.bairro}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Complemento</ui:define>
                <h:inputText id="complemento" value="#{pessoaList.pessoa.complemento}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Cidade</ui:define>
                <h:inputText id="cidade" value="#{pessoaList.pessoa.cidade}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Uf</ui:define>
                <h:inputText id="uf" value="#{pessoaList.pessoa.uf}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Dddtelefone</ui:define>
                <h:inputText id="dddtelefone" value="#{pessoaList.pessoa.dddtelefone}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Telefone</ui:define>
                <h:inputText id="telefone" value="#{pessoaList.pessoa.telefone}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Dddcelular</ui:define>
                <h:inputText id="dddcelular" value="#{pessoaList.pessoa.dddcelular}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Celular</ui:define>
                <h:inputText id="celular" value="#{pessoaList.pessoa.celular}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Rg</ui:define>
                <h:inputText id="rg" value="#{pessoaList.pessoa.rg}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Ssp</ui:define>
                <h:inputText id="ssp" value="#{pessoaList.pessoa.ssp}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Cpfcnpj</ui:define>
                <h:inputText id="cpfcnpj" value="#{pessoaList.pessoa.cpfcnpj}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Profissao</ui:define>
                <h:inputText id="profissao" value="#{pessoaList.pessoa.profissao}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Nacionalidade</ui:define>
                <h:inputText id="nacionalidade" value="#{pessoaList.pessoa.nacionalidade}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Estadocivil</ui:define>
                <h:inputText id="estadocivil" value="#{pessoaList.pessoa.estadocivil}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Email</ui:define>
                <h:inputText id="email" value="#{pessoaList.pessoa.email}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Match</ui:define>
                <h:selectOneRadio id="logic" value="#{pessoaList.restrictionLogicOperator}" styleClass="radio">
                    <f:selectItem itemLabel="All" itemValue="and"/>
                    <f:selectItem itemLabel="Any" itemValue="or"/>
                </h:selectOneRadio>
            </s:decorate>

        </rich:simpleTogglePanel>

        <div class="actionButtons">
            <h:commandButton id="search" value="Search" action="/PessoaList.xhtml"/>
            <s:button id="reset" value="Reset" includePageParams="false"/>
        </div>

    </h:form>

    <rich:panel>
        <f:facet name="header">Pessoa Search Results (#{empty pessoaList.resultList ? 0 : (pessoaList.paginated ? pessoaList.resultCount : pessoaList.resultList.size)})</f:facet>
    <div class="results" id="pessoaList">

    <h:outputText value="The pessoa search returned no results."
               rendered="#{empty pessoaList.resultList}"/>

    <rich:dataTable id="pessoaList"
                var="_pessoa"
              value="#{pessoaList.resultList}"
           rendered="#{not empty pessoaList.resultList}">
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Id pessoa"/>
                    <ui:param name="propertyPath" value="pessoa.idPessoa"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.idPessoa}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Usuario id usuario"/>
                    <ui:param name="propertyPath" value="pessoa.usuarioIdUsuario"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.usuarioIdUsuario}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Conta id conta"/>
                    <ui:param name="propertyPath" value="pessoa.contaIdConta"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.contaIdConta}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Nome"/>
                    <ui:param name="propertyPath" value="pessoa.nome"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.nome}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Endereco"/>
                    <ui:param name="propertyPath" value="pessoa.endereco"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.endereco}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Bairro"/>
                    <ui:param name="propertyPath" value="pessoa.bairro"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.bairro}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Complemento"/>
                    <ui:param name="propertyPath" value="pessoa.complemento"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.complemento}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Cidade"/>
                    <ui:param name="propertyPath" value="pessoa.cidade"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.cidade}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Uf"/>
                    <ui:param name="propertyPath" value="pessoa.uf"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.uf}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Dddtelefone"/>
                    <ui:param name="propertyPath" value="pessoa.dddtelefone"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.dddtelefone}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Telefone"/>
                    <ui:param name="propertyPath" value="pessoa.telefone"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.telefone}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Dddcelular"/>
                    <ui:param name="propertyPath" value="pessoa.dddcelular"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.dddcelular}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Celular"/>
                    <ui:param name="propertyPath" value="pessoa.celular"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.celular}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Rg"/>
                    <ui:param name="propertyPath" value="pessoa.rg"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.rg}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Ssp"/>
                    <ui:param name="propertyPath" value="pessoa.ssp"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.ssp}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Cpfcnpj"/>
                    <ui:param name="propertyPath" value="pessoa.cpfcnpj"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.cpfcnpj}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Profissao"/>
                    <ui:param name="propertyPath" value="pessoa.profissao"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.profissao}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Nacionalidade"/>
                    <ui:param name="propertyPath" value="pessoa.nacionalidade"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.nacionalidade}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Estadocivil"/>
                    <ui:param name="propertyPath" value="pessoa.estadocivil"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.estadocivil}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Email"/>
                    <ui:param name="propertyPath" value="pessoa.email"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.email}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{pessoaList}"/>
                    <ui:param name="propertyLabel" value="Outros"/>
                    <ui:param name="propertyPath" value="pessoa.outros"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_pessoa.outros}"/>
        </h:column>
        <rich:column styleClass="action">
            <f:facet name="header">Action</f:facet>
            <s:link view="/#{empty from ? 'Pessoa' : from}.xhtml"
                   value="#{empty from ? 'View' : 'Select'}"
             propagation="#{empty from ? 'none' : 'default'}"
                      id="pessoaViewId">
                <f:param name="pessoaIdPessoa"
                        value="#{_pessoa.idPessoa}"/>
            </s:link>
            #{' '}
            <s:link view="/PessoaEdit.xhtml"
                   value="Edit"
             propagation="none"
                      id="pessoaEdit"
                rendered="#{empty from}">
                <f:param name="pessoaIdPessoa"
                        value="#{_pessoa.idPessoa}"/>
            </s:link>
        </rich:column>
    </rich:dataTable>

    </div>
    </rich:panel>

    <div class="tableControl">

        <s:link view="/PessoaList.xhtml"
            rendered="#{pessoaList.previousExists}"
               value="#{messages.left}#{messages.left} First Page"
                  id="firstPage">
          <f:param name="firstResult" value="0"/>
        </s:link>

        <s:link view="/PessoaList.xhtml"
            rendered="#{pessoaList.previousExists}"
               value="#{messages.left} Previous Page"
                  id="previousPage">
            <f:param name="firstResult"
                    value="#{pessoaList.previousFirstResult}"/>
        </s:link>

        <s:link view="/PessoaList.xhtml"
            rendered="#{pessoaList.nextExists}"
               value="Next Page #{messages.right}"
                  id="nextPage">
            <f:param name="firstResult"
                    value="#{pessoaList.nextFirstResult}"/>
        </s:link>

        <s:link view="/PessoaList.xhtml"
            rendered="#{pessoaList.nextExists}"
               value="Last Page #{messages.right}#{messages.right}"
                  id="lastPage">
            <f:param name="firstResult"
                    value="#{pessoaList.lastFirstResult}"/>
        </s:link>

    </div>

    <s:div styleClass="actionButtons" rendered="#{empty from}">
        <s:button view="/PessoaEdit.xhtml"
                    id="create"
           propagation="none"
                 value="Create pessoa">
            <f:param name="pessoaIdPessoa"/>
        </s:button>
    </s:div>

</ui:define>

</ui:composition>
